package com.zxl.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @packageName com.zxl.config
 * @ClassName
 * @Author zxl
 * @Description //TODO
 * @date
 **/
@Configuration
public class ESConfig {

    @Bean
    public RestHighLevelClient highLevelClient(){
        HttpHost httpHost = new HttpHost("10.20.151.73",9200);
        RestClientBuilder builder = RestClient.builder(httpHost);
        return new RestHighLevelClient(builder);
    }

}
